package com.qxy.practice.jvm;

/**
 * @author : 戚欣扬
 * @Description :
 */
public class OOMdemo1 {
    byte[] bytes = new byte[1*1024*1024];
    public static void main(String[] args) {
        OOMdemo1 [] arr = new OOMdemo1[1000];
        System.out.println("start memory :"+Runtime.getRuntime().totalMemory()/(1024*1024));
        System.out.println("max memory :"+Runtime.getRuntime().maxMemory()/(1024*1024));
        int i = 0;
        while (true){
            arr[i++]=new OOMdemo1();
        }
    }
}


